import 'package:finance_app/src/entities/report_list_item_entity.dart';

reportListItemEntityFromJson(ReportListItemEntity data, Map<String, dynamic> json) {
	if (json['column'] != null) {
		data.column = json['column'] is String
				? int.tryParse(json['column'])
				: json['column'].toInt();
	}
	if (json['style'] != null) {
		data.style = json['style'].toString();
	}
	if (json['row'] != null) {
		data.row = json['row'] is String
				? int.tryParse(json['row'])
				: json['row'].toInt();
	}
	if (json['values'] != null) {
		data.values = (json['values'] as List).map((v) => v.toString()).toList().cast<String>();
	}
	if (json['meta'] != null) {
		data.meta = json['meta'];
	}
	return data;
}

Map<String, dynamic> reportListItemEntityToJson(ReportListItemEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['column'] = entity.column;
	data['style'] = entity.style;
	data['row'] = entity.row;
	data['values'] = entity.values;
	data['meta'] = entity.meta;
	return data;
}